﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WCS.Service.Interface;

namespace WCS.Api.Admin.Controllers
{
    /// <summary>
    /// 易票联支付模块
    /// </summary>
    public class EpaylinksPayController : BaseController
    {
        private readonly IConfiguration _configuration;
        private readonly IEpaylinksPayService _epaylinksPayService;

        public EpaylinksPayController(IConfiguration configuration, IEpaylinksPayService epaylinksPayService, IUserService userService) : base(userService)
        {
            _configuration = configuration;
            _epaylinksPayService = epaylinksPayService;
        }

        /// <summary>
        /// 测试易票联接口
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public async Task<IActionResult> Test()
        {
            var result = await _epaylinksPayService.Test();
            return Ok(result);
        }

        /// <summary>
        /// 统一下单测试
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public async Task<IActionResult> UnifiedPayment()
        {
            var result = await _epaylinksPayService.UnifiedPaymentTest();
            return Ok(result);
        }

        /// <summary>
        /// 提现代付测试
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public async Task<IActionResult> WithdrawalToCardTest()
        {
            var result = await _epaylinksPayService.WithdrawalToCardTest();
            return Ok(result);
        }
    }
}
